<h1>Listing restaurants</h1>

<table>
  <tr>
    <th>Name</th>
    <th>Description</th>
    <th>Phone</th>
    <th>Address</th>
    <th>Created by</th>
  </tr>

<% for restaurant in @restaurants %>
  <tr>
    <td><%=link_to h(restaurant.name), restaurant %></td>
    <td><%= h restaurant.description %></td>
    <td><%= h restaurant.phone %></td>
    <td><%= h restaurant.address %></td>
    <td><%= link_to h(restaurant.user.login), restaurant.user if restaurant.user %></td>
    <td><%= link_to 'Edit', edit_restaurant_path(restaurant) %></td>
    <td><%= link_to 'Destroy', restaurant, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New restaurant', new_restaurant_path %>
